public  class Teacher {
    private String teacherId;   // 教师编号
    private String name;        // 教师姓名
    private String gender;      // 教师性别
    private Course course;      // 所授课程

    // 构造方法
    public Teacher(String teacherId, String name, String gender) {
        this.teacherId = teacherId;
        this.name = name;
        this.gender = gender;
    }

    // 教师“开课”方法
    public void openCourse(Course course) {
        this.course = course;
        course.setTeacher(this); // 课程关联教师
        System.out.println(name + " 教师成功开设 " + course.getCourseName() + " 课程");
    }

    // Getter 和 Setter 方法
    public String getTeacherId() { return teacherId; }
    public void setTeacherId(String teacherId) { this.teacherId = teacherId; }
    public String getName() { return name; }
    public void setName(String name) { this.name = name; }
    public String getGender() { return gender; }
    public void setGender(String gender) { this.gender = gender; }
    public Course getCourse() { return course; }
    public void setCourse(Course course) { this.course = course; }
}